----------------------------------------------------------------------------------
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output/figureA4.log
  log type:  text
 opened on:   3 Dec 2023, 18:18:50

. 
. version 16      

. 
. use "$data/ctctaxsim_mar1kid1.dta", clear

. append using "$data/ctctaxsim_mar1kid2.dta"
(label YEAR already defined)

. append using "$data/ctctaxsim_mar1kid3.dta"
(label YEAR already defined)

. tab depx

       depx |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     20,000       33.33       33.33
          2 |     20,000       33.33       66.67
          3 |     20,000       33.33      100.00
------------+-----------------------------------
      Total |     60,000      100.00

. 
. sum fiitax earnings fedtaxlessctc v25 totctc

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      fiitax |     60,000   -902.5994    4682.152    -9708.5     9338.5
    earnings |     60,000      49.995    28.86775          0      99.99
fedtaxless~c |     60,000    1616.028    4785.037      -6431    10338.5
         v25 |     60,000    1.601453    2.071323          0      6.431
      totctc |     60,000    2.518628    1.614441          0          6

. replace earnings=earnings*1000
(59,994 real changes made)

. replace ctc=ctc*1000
(60,000 real changes made)

. replace v25=v25*1000
(30,208 real changes made)

. replace totctc=totctc*1000
(58,344 real changes made)

. sum fiitax earnings fedtaxlessctc v25 totctc

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      fiitax |     60,000   -902.5994    4682.152    -9708.5     9338.5
    earnings |     60,000       49995    28867.75          0      99990
fedtaxless~c |     60,000    1616.028    4785.037      -6431    10338.5
         v25 |     60,000    1601.453    2071.323          0       6431
      totctc |     60,000    2518.628    1614.441          0       6000

. 
. gen avgtaxrate=fiitax/earnings
(6 missing values generated)

. gen avgtaxrate2021=fedtaxlessctc/earnings       /* Don't include new CTC */
(6 missing values generated)

. 
. gen avgtaxeitc=-v25/earnings
(6 missing values generated)

. gen avgtaxctc=-totctc/earnings
(6 missing values generated)

. gen avgtaxctc2021=0

. 
. gen avgtaxeitcctc=avgtaxeitc+avgtaxctc
(6 missing values generated)

. 
. *br avgtaxrate avgtaxeitcctc avgtaxeitc avgtaxctc earnings year depx if year==20
> 18
. *br avgtaxrate avgtaxeitcctc avgtaxeitc avgtaxctc earnings year depx avginctax i
> f year==2017
. gen avginctax=avgtaxrate- avgtaxeitcctc
(6 missing values generated)

. 
. tab year avginctax if earnings==40000 & depx==1

    census |       avginctax
      year |   .037875        .04 |     Total
-----------+----------------------+----------
      2017 |         1          0 |         1 
      2018 |         0          1 |         1 
-----------+----------------------+----------
     Total |         1          1 |         2 

. replace avginctax=avginctax*.04/.037875 if year==2017
(23,260 real changes made)

. tab year avginctax if earnings==40000 & depx==1

    census | avginctax
      year |       .04 |     Total
-----------+-----------+----------
      2017 |         1 |         1 
      2018 |         1 |         1 
-----------+-----------+----------
     Total |         2 |         2 

. 
. foreach var in avgtaxeitc avgtaxctc avgtaxctc2021 avginctax{
  2.         replace `var'=-`var'
  3. }
(30,208 real changes made)
(58,344 real changes made)
(0 real changes made)
(47,588 real changes made)

. 
. foreach var in avgtaxeitc avgtaxctc avgtaxctc2021 avginctax{
  2.         replace `var'=`var'+1
  3. }
(59,994 real changes made)
(59,994 real changes made)
(60,000 real changes made)
(59,994 real changes made)

. 
. 
. twoway line avgtaxeitc earnings if year==2017 & depx==1, pstyle(p1) || line avgt
> axctc earnings if year==2017 & depx==1, lp(_) pstyle(p2) || line avgtaxctc earni
> ngs if year==2018 & depx==1, lp(-) pstyle(p2) || line avgtaxctc2021 earnings if 
> year==2018 & depx==1, lw(thick) pstyle(p2) || line avginctax earnings if year==2
> 017 & depx==1, pstyle(p3) || line avginctax earnings if year==2018 & depx==1, ps
> tyle(p3) lp(-) graphregion(color(white)) bgcolor(white) leg(off) ytitle("Return 
> to Work") xtitle("Earnings" "{bf:Panel A: One Child}") text(1.4 50000 "Families 
> with 1 Kid" , j(left) size(medsmall)) ylabel(.75(.25)1.5)

. graph save "$output/avgtaxdecomp_mar1kid1.gph", replace
(file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/avgtaxdecomp_mar1kid1.gph not found)
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication files/out
> put/avgtaxdecomp_mar1kid1.gph saved

. 
. twoway line avgtaxeitc earnings if year==2017 & depx==1, pstyle(p1) || line avgt
> axctc earnings if year==2017 & depx==2, lp(_) pstyle(p2) || line avgtaxctc earni
> ngs if year==2018 & depx==2, lp(-) pstyle(p2) || line avgtaxctc2021 earnings if 
> year==2018 & depx==2,  lw(thick) pstyle(p2) || line avginctax earnings if year==
> 2017 & depx==2, pstyle(p3) || line avginctax earnings if year==2018 & depx==2, p
> style(p3) lp(-) graphregion(color(white)) bgcolor(white) leg(off) ytitle("Return
>  to Work") xtitle("Earnings" "{bf:Panel B: Two Children}") text(1.4 50000 "Famil
> ies with 2 Kids" , j(left) size(medsmall)) ylabel(.75(.25)1.5)

. graph save "$output/avgtaxdecomp_mar1kid2.gph", replace
(file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/avgtaxdecomp_mar1kid2.gph not found)
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication files/out
> put/avgtaxdecomp_mar1kid2.gph saved

. 
. twoway line avgtaxeitc earnings if year==2017 & depx==3, pstyle(p1) || line avgt
> axctc earnings if year==2017 & depx==3, lp(_) pstyle(p2) || line avgtaxctc earni
> ngs if year==2018 & depx==3, lp(-) pstyle(p2) || line avgtaxctc2021 earnings if 
> year==2018 & depx==3,  lw(thick) pstyle(p2) || line avginctax earnings if year==
> 2017 & depx==3, pstyle(p3) || line avginctax earnings if year==2018 & depx==3, p
> style(p3) lp(-) graphregion(color(white)) bgcolor(white) leg(off) ytitle("Return
>  to Work") xtitle("Earnings" "{bf:Panel C: Three Children}") text(1.4 50000 "Fam
> ilies with 3 Kids" , j(left) size(medsmall)) ylabel(.75(.25)1.5)

. graph save "$output/avgtaxdecomp_mar1kid3.gph", replace
(file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/avgtaxdecomp_mar1kid3.gph not found)
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication files/out
> put/avgtaxdecomp_mar1kid3.gph saved

. 
. *** I just use this one to grab the legend and copy into the main figure
. twoway line avgtaxeitc earnings if year==2017 & depx==3, pstyle(p1) || line avgt
> axctc earnings if year==2017 & depx==3, lp(_) pstyle(p2) || line avgtaxctc earni
> ngs if year==2018 & depx==3, lp(-) pstyle(p2) || line avgtaxctc2021 earnings if 
> year==2018 & depx==3,  lw(thick) pstyle(p2) || line avginctax earnings if year==
> 2017 & depx==3, pstyle(p3) || line avginctax earnings if year==2018 & depx==3, p
> style(p3) lp(-) graphregion(color(white)) bgcolor(white) leg(order(1 "EITC" 2 "C
> TC 2017" 3 "CTC 2020" 4 "CTC 2021" 5 "Income Tax 2017" 6 "Income Tax 2020") c(1)
>  pos(5) ring(0)) ytitle("Average Tax Rate") xtitle("Earnings" "{bf:Panel C}") te
> xt(.15 50000 "Families with 3 Kids" , j(left) size(medsmall)) ylabel(-.5(.25).25
> )

. graph save "$output/forlegend.gph", replace
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication files/out
> put/forlegend.gph saved

. 
. graph combine "$output/avgtaxdecomp_mar1kid1.gph" "$output/avgtaxdecomp_mar1kid2
> .gph" "$output/avgtaxdecomp_mar1kid3.gph",graphregion(color(white)) 

. graph export "$output/figureA4.png", replace
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/figureA4.png saved as PNG format

. 
. erase "$output/avgtaxdecomp_mar1kid1.gph"

. erase "$output/avgtaxdecomp_mar1kid2.gph"

. erase "$output/avgtaxdecomp_mar1kid3.gph"

. 
. log close
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output/figureA4.log
  log type:  text
 closed on:   3 Dec 2023, 18:18:55
----------------------------------------------------------------------------------
